<template>
	<view class="u-wrap u-p-1-20 u-p-r-20" style="margin-left: 10px;">
		<u-form :model="addModel" ref="form1">
			<u-form-item label="类型:">
				<u-radio-group v-model="addModel.type">
						<u-radio activeColor="#00cc33" v-for="(item,index) in list" :key="index" :name="item.name"
						:disabled="item.disabled">
						{{ item.name }}
						</u-radio>
				</u-radio-group>
			</u-form-item>
			<u-form-item label="名称">
				<u-input placeholder="请输入名称" v-model="addModel.title"></u-input>
			</u-form-item>
			<u-form-item label="简介">
				<u-input placeholder="请输入简介" v-model="addModel.introduce"></u-input>
			</u-form-item>
			<u-form-item label="价格">
				<u-input placeholder="请输入价格" v-model="addModel.price"></u-input>
			</u-form-item>
			<u-form-item label="联系人:" label-width="auto">
				<u-input placeholder="请输入联系人" v-model="addModel.userName"></u-input>
			</u-form-item>
			<u-form-item label="联系电话:" label-width="auto">
				<u-input placeholder="请输入联系电话" v-model="addModel.phone"></u-input>
			</u-form-item>
			<u-form-item label="图片"></u-form-item>
			<u-upload :action="action" :file-list="fileList" ></u-upload>
		</u-form>
		<u-button :custom-style="customStyle">发布</u-button>
	</view>
</template>

<script setup>
	import{
		reactive,
		ref
	} from 'vue';
	
	//表单数据
	const addModel = reactive({
		type:'',
		title:'',
		introduce:'',
		price:'',
		userName:'',
		phone:'',
		image:''
	})
	
	//物品发布类型
	const list =[
		{
		name:'闲置',
		disabled:false
	    },
		{
		name:'求购',
		disabled:false
		},
	]
	
	//图片上传
	const value = ref('')
	const action = ref('')
	const fileList = ref([])
	
	//发布按钮
	const customStyle = reactive({
		background:'#00cc33',
		color:'#FFF',
		marginTop:'15px',
		width:'100%'
	})
</script>

<style>

</style>
